//
//  QRNavigationController.m
//  danpin
//
//  Created by chuangjia on 9/11/2015.
//  Copyright © 2015 chuangjia. All rights reserved.
//

#import "QRNavigationController.h"
#import "QRReaderViewController.h"
@interface QRNavigationController ()

@end

@implementation QRNavigationController

+ (instancetype)newWithQRDelegate:(id<QRDelegate>)delegate
{
    QRNavigationController *navigationController = [super new];
    navigationController.navigationBarHidden = YES;
    [navigationController setEnableBackGesture:YES];
    if (navigationController) {
        [navigationController setupAuthorizedWithDelegate:delegate];
    }
    
    return navigationController;
}
- (void)setupAuthorizedWithDelegate:(id<QRDelegate>)delegate
{
    QRReaderViewController *viewController = [QRReaderViewController new];
    viewController.delegate = delegate;
    self.viewControllers = @[viewController];
}

@end
